#include <iostream>
using namespace std;

int main()
{
    int n;
    cin>>n;
    int* nums=new int[n];
    for (int i=0;i<n;i++)
    {
        cin>>nums[i];
    }
    int a,b;
    cin>>a>>b;
    bool isout=false;
    for (int i=0;i<n;i++)
    {
        if (isout&&!(nums[i]>=a&&nums[i]<=b))
            cout<<" "<<nums[i];
        else if (!isout&&!(nums[i]>=a&&nums[i]<=b))
        {
            isout=true;
            cout<<nums[i];
        }
    }
}